// EmoticonLoader.h: interface for the CEmoticonLoader class.
//
//////////////////////////////////////////////////////////////////////

#if !defined(AFX_EMOTICONLOADER_H__46CAB6BA_F691_4ABC_980F_7975ED467540__INCLUDED_)
#define AFX_EMOTICONLOADER_H__46CAB6BA_F691_4ABC_980F_7975ED467540__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

#include <afxtempl.h>
#include <afxmt.h>

//#include "LibUtility.h"
//class LIB_UTILITY_DLLAPI CEmoticonLoader  
class CEmoticonLoader
{
public:
	enum {eUSE_NORMAL, eUSE_MIM};
	enum {eIMG_NORMAL,eIMG_ANI};

	struct EMOTICON_ITEM
	{
		CString strEmoticonStr;
		CString strEmoticonFile;
		CString strMsnEmoticonStr1;
		CString strMsnEmoticonStr2;
		int nImgType ;
	};
	
	typedef EMOTICON_ITEM* LPEMOTICON_ITEM;

	CEmoticonLoader();
	virtual ~CEmoticonLoader();

	static BOOL LoadEmoticons(const CString& strEmoticonFileDir, const CString& strXMLFilePath, int nUseMode, BOOL bUserEmoticon=FALSE);
	static void UnloadEmoticons();

	static CString ConvertStrToHTML(CString szStr, CString strEmoticonDir, BOOL bIncludeAttr = FALSE);

protected:
	static CArray<LPEMOTICON_ITEM, LPEMOTICON_ITEM> ms_arrEmoticonItems;
	static CArray<LPEMOTICON_ITEM, LPEMOTICON_ITEM> ms_arrEmoticonItems_MIM;
	static BOOL ms_bLoaded;
	static CCriticalSection ms_Lock;
};

#endif // !defined(AFX_EMOTICONLOADER_H__46CAB6BA_F691_4ABC_980F_7975ED467540__INCLUDED_)
